package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 结算类型(PREPAYMENT-预付结算 FINAL-结案结算)
 */
@Getter
@AllArgsConstructor
public enum ClaimSettlementTypeEnum {
    PREPAYMENT("PREPAYMENT", "预付结算"),
    FINAL("FINAL", "结案结算"),

    ;

    public static ClaimSettlementTypeEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String name;
}
